define(['zepto', 'butterfly/view','../../bsl',
    'text!./navigator.html'
], function($, View, bsl, Navigator) {
    var me = null;

    var view = View.extend({
        events: {

            // ！！！！ 由于 引入 touch.js 后，tap事件会变成双击，所以 本页面内不能使用tap，用click代替。
            "tap #openDoc" : "openDoc",
            "tap #back" : "back",
            "tap .fullscreen" : "fullscreen",
            "tap .unfullscreen" : "unfullscreen",
            "tap .isfullscreen" : "isfullscreen",
            "tap .customerNavigator" : "customerNavigator",

      
        },
        render: function() {
            me = this;
        },

        onShow: function() {

            // 绑定自定义事件 滑动切换日历等           


        },
               fullscreen: function (){
            console.info( "应用全屏显示！" );
            bsl.navigator.setFullscreen(true);
        },
        unfullscreen:function (){
            console.info( "应用非全屏显示！" );
            bsl.navigator.setFullscreen(false);
        },
        isfullscreen:function (){
            console.info( "是否全屏："+(bsl.navigator.isFullscreen()?"是":"否") );
        },

        customerNavigator:function (){
            var wn=clicked('navigator_status.html');
            var bcolor=bsl.navigator.getStatusBarBackground();
            var bstyle=bsl.navigator.getStatusBarStyle();
            wn.addEventListener('close',function(){
                //页面关闭后状态栏重置回以前的颜色
                bsl.navigator.setStatusBarBackground(bcolor);
                //页面关闭后状态栏重置回以前的样式
                bsl.navigator.setStatusBarStyle(bstyle);
            },false);
        },
                  back : function(e){
                    window.history.go(-1);
                },
                openDoc:function(){
                     window.butterfly.navigate('com.no5.cordovademo/doc/navigator', {
                        trigger: true
                    });


                },
        
      
             
            });
    return view;
});
